1. Field of the Invention
The present invention relates to an improved data managing technique for managing data units which are subject to a predetermined order or sequence, such as data units whose contents are changed with a lapse of time, so as to enable a high-speed retrieval of such a data unit corresponding to a time point of an occurrence of change in contents, from among the data units.
2. Description of the Related Art
There has been known a data managing technique for managing data units subject to a predetermined sequence so as to provide a logical data structure which meets a user""s requirement. For example, it has been popularized in business enterprises to manage data of all the employees using a data managing apparatus in the form of a computer. The employees"" data is composed of records each including data units on those items, such as name, sex, address, date of birth, working section and title of an employee. It is normal that each record is changed in contents with a lapse of time. As the cause of change, change in address, change in working section, promotion or the like may be cited.
When a record is changed in contents, it is preferable that the new contents are stored in addition to the old contents rather than merely replacing the old contents with the new contents, so that a record at a desired past time can be obtained upon request. In view of this, in the conventional technique, record storage locations are arranged in time sequence for storing records in turn, and a required record is read from the corresponding record storage location upon request.
When it is necessary to check whether data on a particular item of a certain employee has been changed, comparison is made between adjacent data units on that particular item stored in time sequence so as to judge whether a data change has been caused.
If a record to be checked is identified, an occurrence of data change is judged by comparing a data unit on the particular item of that record and a data unit on the particular item of a record stored adjacently thereto in time sequence. On the other hand, if a record to be checked is not identified, it is necessary to retrieve and read data units on the particular item with respect to all the records of the certain employee, and compare them between the adjacent records in turn.
For example, for retrieving a record at a time point when data on item xe2x80x9ctitlexe2x80x9d of a certain employee was changed to xe2x80x9cmanagerxe2x80x9d. it is necessary to check data units on item xe2x80x9ctitlexe2x80x9d in employee data of that employee in time sequence. thereby to identify the record which first stores xe2x80x9cmanagerxe2x80x9d. Accordingly, in such a retrieval operation, it is necessary to compare records in turn in time sequence and identify a record which first stores objective data. This is required because, for example, if data on item xe2x80x9caddressxe2x80x9d is changed after the title is changed to xe2x80x9cmanagerxe2x80x9d, a new record is added so that there exist a plurality of records in which the title is xe2x80x9cmanagerxe2x80x9d. Thus, without comparing in turn the records in time sequence and identifying the record which first stores the objective data, there is a possibility that a record subsequent to a record which first stores xe2x80x9cmanagerxe2x80x9d is retrieved.
Accordingly, when the employees"" data is large in amount or the number of records included in the employee data of each employee is large, the retrieval time is prolonged. The number of records may be increased as the number of items constituting a record Is increased.
As appreciated from the foregoing description, in the employees"" data managed by the data managing apparatus, a plurality of items, i.e. a plurality of data units on those items, are handled as one unit. i.e. per record, so that actual recording or reading of data is performed per record. Therefore, for example, even if a user wishes to only obtain a data unit of a certain record with respect to a particular item, not only the data unit on the particular item but also data units on the other items are simultaneously read. Thus, as the number of items is increased, it takes more time to read one record, thereby to prolong the read time for such data that is unnecessary for a retrieval process.
As described above, owing to the retrieval process following the sequence of data and the recording and reading of data per record, the time unnecessary for the retrieval process is prolonged as the number of records or items is increased, which may spoil the practicality of the conventional data managing apparatus.
Therefore, it is an object of the present invention to provide an improved data managing method which can solve one or more of the foregoing problems.
It is another object of the present invention to provide an improved data managing apparatus which can solve one or more of the foregoing problems.
It is another object of the present invention to provide a recording medium for realizing the foregoing improved data managing method or apparatus using a computer.
According to one aspect of the present invention, there is provided a data managing method for storing and reading data units subject to a predetermined sequence, the method comprising a recording step of comparing, every time a data unit is inputted, the inputted data unit with a data unit stored immediately before, and storing a change bit associated with the inputted data unit, the change bit set to a different value between cases when both data units are the same with each other and when both data units differ from each other: and a retrieval step of referring to the change bits to identify a change point in values thereof, and retrieving a data unit corresponding to the change bit at the identified change point as a data unit whose contents have been changed.
It may be arranged that the retrieval step checks the change bits in a predetermined retrieval direction and, when the change bit represents that both data units are the same with each other, the retrieval step ignores such a change bit.
It may be arranged that the retrieval step comprises a step of reading the change bits per given number for detecting whether the change point exists therein.
According to another aspect of the present invention, there is provided a data managing apparatus comprising a data file for storing records each of which includes at least one item for a corresponding data unit, the data units subject to a predetermined sequence: an index file associated with the item: and record control means for controlling storing into the data file and the index file, wherein, responsive to a request for recording a data unit with respect to the item, the record control means produces a new record including the requested data unit and stores the new record into the data file, and further stores a change bit into the index file, the change bit representing whether the requested data unit in the new record differs from a data unit stored immediately before with respect to the item.
According to another aspect of the present invention, there is provided a data managing apparatus comprising a data file storing records each of which includes at least one item having a corresponding data unit, the data units subject to a predetermined sequence: an index file associated with the item and storing change bits representing whether the data units of the item have been changed In the predetermined sequence: and read control means for controlling reading from the data file and the index file, wherein, responsive to a retrieval request for a record whose data unit with respect to the item has been changed in contents, the read control means identifies the requested record based on the change bits stored in the index file.
It may be arranged that the data managing apparatus further comprises means for defining a relationship between information units for identifying the records stored in the data file and time information units, wherein one of the records is identified based on corresponding one of the time information units.
According to another aspect of the present invention, there is provided a computer-readable recording medium storing a program which causes a computer to execute the steps of forming a data file for storing records each of which includes at least one item for a corresponding data unit. the data units subject to a predetermined sequence; forming an index file associated with the item; producing, responsive to a request for recording a data unit with respect to the item, a new record including the requested data unit; storing the new record into the data file: and storing a change bit into the index file, the change bit representing whether the requested data unit in the new record differs from a data unit stored immediately before with respect to the item.
According to another aspect of the present invention, there is provided a computer-readable recording medium storing a program which causes a computer to execute the steps of forming a data file storing records each of which includes at least one item having a corresponding data unit, the data units subject to a predetermined sequence; forming an index file associated with the item and storing change bits representing whether the data units of the item have been changed in the predetermined sequence; referring, responsive to a retrieval request for a record whose data unit with respect to the item has been changed in contents, to the change bits stored in the index file; and identifying the requested record based on the referred change bits.